package dream.util;

import java.text.SimpleDateFormat;
import java.util.Date;

public class DateFormatUtil {

    public static String getFormat(Date date){
        String s = new SimpleDateFormat().format(date);
        return s.split("/")[0] + "年" + s.split("/")[1] + "月" + s.split("/")[2].split(" ")[0] + "日";
    }

    public static String getFormat(long date){
        String s = new SimpleDateFormat().format(new Date(date));
        return s.split("/")[0] + "年" + s.split("/")[1] + "月" + s.split("/")[2].split(" ")[0] + "日";
    }

    public static String getYear(long date){
        String s = new SimpleDateFormat().format(new Date(date));
        return s.split("/")[0];
    }

}
